package com.x_memteor.base_master.bean.response;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: X_Meteor
 * @description: 类描述
 * @version: V_1.0.0
 * @date: 2018/3/12 0012 下午 9:41
 * @company:
 * @email: lx802315@163.com
 */
public class HeartBean implements Parcelable {

    /**
     * server_time : 1519548537
     * mac_on_off : {"mac_close_time":"2018-02-25 16:48:57","next_open_time":"2018-02-26 16:48:57"}
     * mac_banner : [{"id":1,"url":"http://xxx1.jpeg","update_time":1519539598},{"id":2,"url":"http://xxx2.jpeg","update_time":1519546880}]
     * islight : 1
     * volnum : 90
     * last_version_id : 2.0
     */

    private int server_time;
    private MacOnOffBean mac_on_off;
    private int islight;
    private int volnum;
    private String last_version_id;
    private List<MacBannerBean> mac_banner;

    public int getServer_time() {
        return server_time;
    }

    public void setServer_time(int server_time) {
        this.server_time = server_time;
    }

    public MacOnOffBean getMac_on_off() {
        return mac_on_off;
    }

    public void setMac_on_off(MacOnOffBean mac_on_off) {
        this.mac_on_off = mac_on_off;
    }

    public int getIslight() {
        return islight;
    }

    public void setIslight(int islight) {
        this.islight = islight;
    }

    public int getVolnum() {
        return volnum;
    }

    public void setVolnum(int volnum) {
        this.volnum = volnum;
    }

    public String getLast_version_id() {
        return last_version_id;
    }

    public void setLast_version_id(String last_version_id) {
        this.last_version_id = last_version_id;
    }

    public List<MacBannerBean> getMac_banner() {
        return mac_banner;
    }

    public void setMac_banner(List<MacBannerBean> mac_banner) {
        this.mac_banner = mac_banner;
    }

    public static class MacOnOffBean implements Parcelable {
        /**
         * mac_close_time : 2018-02-25 16:48:57
         * next_open_time : 2018-02-26 16:48:57
         */

        private String mac_close_time;
        private String next_open_time;

        public String getMac_close_time() {
            return mac_close_time;
        }

        public void setMac_close_time(String mac_close_time) {
            this.mac_close_time = mac_close_time;
        }

        public String getNext_open_time() {
            return next_open_time;
        }

        public void setNext_open_time(String next_open_time) {
            this.next_open_time = next_open_time;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.mac_close_time);
            dest.writeString(this.next_open_time);
        }

        public MacOnOffBean() {
        }

        protected MacOnOffBean(Parcel in) {
            this.mac_close_time = in.readString();
            this.next_open_time = in.readString();
        }

        public static final Creator<MacOnOffBean> CREATOR = new Creator<MacOnOffBean>() {
            @Override
            public MacOnOffBean createFromParcel(Parcel source) {
                return new MacOnOffBean(source);
            }

            @Override
            public MacOnOffBean[] newArray(int size) {
                return new MacOnOffBean[size];
            }
        };
    }

    public static class MacBannerBean implements Parcelable {
        /**
         * id : 1
         * url : http://xxx1.jpeg
         * update_time : 1519539598
         */

        private int id;
        private String url;
        private int update_time;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getUpdate_time() {
            return update_time;
        }

        public void setUpdate_time(int update_time) {
            this.update_time = update_time;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.id);
            dest.writeString(this.url);
            dest.writeInt(this.update_time);
        }

        public MacBannerBean() {
        }

        protected MacBannerBean(Parcel in) {
            this.id = in.readInt();
            this.url = in.readString();
            this.update_time = in.readInt();
        }

        public static final Creator<MacBannerBean> CREATOR = new Creator<MacBannerBean>() {
            @Override
            public MacBannerBean createFromParcel(Parcel source) {
                return new MacBannerBean(source);
            }

            @Override
            public MacBannerBean[] newArray(int size) {
                return new MacBannerBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.server_time);
        dest.writeParcelable(this.mac_on_off, flags);
        dest.writeInt(this.islight);
        dest.writeInt(this.volnum);
        dest.writeString(this.last_version_id);
        dest.writeList(this.mac_banner);
    }

    public HeartBean() {
    }

    protected HeartBean(Parcel in) {
        this.server_time = in.readInt();
        this.mac_on_off = in.readParcelable(MacOnOffBean.class.getClassLoader());
        this.islight = in.readInt();
        this.volnum = in.readInt();
        this.last_version_id = in.readString();
        this.mac_banner = new ArrayList<MacBannerBean>();
        in.readList(this.mac_banner, MacBannerBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<HeartBean> CREATOR = new Parcelable.Creator<HeartBean>() {
        @Override
        public HeartBean createFromParcel(Parcel source) {
            return new HeartBean(source);
        }

        @Override
        public HeartBean[] newArray(int size) {
            return new HeartBean[size];
        }
    };
}
